package com.example.concurrentprogramming8016.thread;

import java.util.concurrent.locks.LockSupport;

/**
 * @author liyanhao
 * @Date 2023-01-04 2:32
 */
public class LockSupperTest2 {
    public static void main(String[] args) {
        Thread thread = new Thread(new ParkThread());
        thread.start();
        System.out.println("唤醒parkThread");
        LockSupport.unpark(thread);
    }

    static class ParkThread implements Runnable {
        @Override
        public void run() {
            System.out.println("ParkThread 开始执行");
            LockSupport.park();
            System.out.println("ParkThread 执行完毕");

        }
    }
}
